package com.keyware.kd.repository.mybatis.itf;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.keyware.kd.repository.entity.Permission;
import com.keyware.kd.repository.entity.Role;
import com.keyware.kd.vo.RoleVo;
import com.keyware.kd.vo.user.UserVo;

public interface RoleMapper {
    int deleteByPrimaryKey(String roleId);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(String roleId);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);
    
    //无调用   无主动调用,userMapper.xml自定义查询中调用
    List<Permission> selectRolePermission(String roleId);
    
    /**
     * 
     * @Title: selectByRole
     * @Description: 根据任意属性查询
     * @param role
     * @return
     * @return List<Role>
     */
    List<Role> selectByRole(Role role);

    /**
     * 
     * @author: 赵亚舟
     * @Title: selectRoleUserByRoleId
     * @Description: 查询当前用户下所有角色
     * @param roleId
     * @return
     * @return List<User>
     */
	List<UserVo> selectRoleUserByRoleId(@Param("roleId")String roleId,@Param("projectSource")String projectSource);

	/**
	 *	@Title
	 *  @author 李涛
	 *  @param 
	 *  @date   2017年1月19日
	 *  @return List<Role>
	 */
	List<Role> selectByRoleSelect(Role roleSelect);

	/**
	 * 
	 * @Title: selectRoleVoSelective
	 * @Description: 根据条件查询角色，顺带查出角色下的人员
	 * @param role
	 * @return
	 * @author 巨李岗
	 * @return List<RoleVo>
	 */
	List<RoleVo> selectRoleVoSelective(Role role);
	
	
 /**
     * 
     * @author: 贺雷雷
     * @Title: selectRoleUserByRoleId
     * @Description: 查询当前用户下所有角色
     * @param roleId
     * @return
     * @return List<User>
     */
	List<UserVo> selectRoleUserByUserId(@Param("userId")String roleId,@Param("projectSource")String projectSource);

	/**
	 * 
	 * @Title: selectRoleUserByRoleIds
	 * @Description: 获取用户信息通过角色id集合
	 * @param roleIdList
	 * @param projectName
	 * @return
	 * @author 李军荣
	 * @return List<UserVo>
	 */
    List<UserVo> selectRoleUserByRoleIds(@Param("roleIdList")List<String> roleIdList, 
    		@Param("projectSource")String projectSource);

	/**
	 *
	 * @Title: selectRoleListByUserId
	 * @Description: 获取人员对应的角色权限
	 * @param  userId,projectSource
	 * @author 李军荣
	 * @return java.util.List<com.keyware.kd.repository.entity.Role>
	 */
	List<Role> selectRoleListByUserId(@Param("userId")String userId,@Param("projectSource")String projectSource);


	/**
	 * @Author: 韩丽霞
	 * @Title: selectRoleUserByRoleId17suo
	 * @Description: 查询当前角色下所有用户，返回对象中带有人员密级（针对四院17所）
	 * @Param: [roleId, projectSource]
	 * @Return: java.util.List<com.keyware.kd.vo.user.UserVo>
	 *
	 */
	List<UserVo> selectRoleUserByRoleId17suo(@Param("roleId")String roleId,@Param("projectSource")String projectSource);

}